﻿<%@ Page Language="C#" MasterPageFile="~/Admin.Master" AutoEventWireup="true" CodeBehind="Admin_QLTheLoai.aspx.cs" Inherits="ppm_BaByShop.WebForm22" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <p>
        QUẢN LÝ THỂ LOẠI</p>
    <p>
        <asp:DetailsView ID="DetailsView1" runat="server" AllowPaging="True" 
            AutoGenerateRows="False" DataKeyNames="ma_loai_sp" 
            DataSourceID="SqlDataSource1" Height="50px" Width="125px">
            <Fields>
                <asp:BoundField DataField="ma_loai_sp" HeaderText="ma_loai_sp" ReadOnly="True" 
                    SortExpression="ma_loai_sp" />
                <asp:BoundField DataField="ten_loai_sp" HeaderText="ten_loai_sp" 
                    SortExpression="ten_loai_sp" />
                <asp:BoundField DataField="ma_tt_loai_sp" HeaderText="ma_tt_loai_sp" 
                    SortExpression="ma_tt_loai_sp" />
                <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" 
                    ShowInsertButton="True" />
            </Fields>
        </asp:DetailsView>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConflictDetection="CompareAllValues" 
            ConnectionString="<%$ ConnectionStrings:ppm_BaByShopConnectionString1 %>" 
            DeleteCommand="DELETE FROM [LOAI_SP] WHERE [ma_loai_sp] = @original_ma_loai_sp AND [ten_loai_sp] = @original_ten_loai_sp AND [ma_tt_loai_sp] = @original_ma_tt_loai_sp" 
            InsertCommand="INSERT INTO [LOAI_SP] ([ma_loai_sp], [ten_loai_sp], [ma_tt_loai_sp]) VALUES (@ma_loai_sp, @ten_loai_sp, @ma_tt_loai_sp)" 
            OldValuesParameterFormatString="original_{0}" 
            SelectCommand="SELECT * FROM [LOAI_SP]" 
            UpdateCommand="UPDATE [LOAI_SP] SET [ten_loai_sp] = @ten_loai_sp, [ma_tt_loai_sp] = @ma_tt_loai_sp WHERE [ma_loai_sp] = @original_ma_loai_sp AND [ten_loai_sp] = @original_ten_loai_sp AND [ma_tt_loai_sp] = @original_ma_tt_loai_sp">
            <DeleteParameters>
                <asp:Parameter Name="original_ma_loai_sp" Type="String" />
                <asp:Parameter Name="original_ten_loai_sp" Type="String" />
                <asp:Parameter Name="original_ma_tt_loai_sp" Type="Int32" />
            </DeleteParameters>
            <UpdateParameters>
                <asp:Parameter Name="ten_loai_sp" Type="String" />
                <asp:Parameter Name="ma_tt_loai_sp" Type="Int32" />
                <asp:Parameter Name="original_ma_loai_sp" Type="String" />
                <asp:Parameter Name="original_ten_loai_sp" Type="String" />
                <asp:Parameter Name="original_ma_tt_loai_sp" Type="Int32" />
            </UpdateParameters>
            <InsertParameters>
                <asp:Parameter Name="ma_loai_sp" Type="String" />
                <asp:Parameter Name="ten_loai_sp" Type="String" />
                <asp:Parameter Name="ma_tt_loai_sp" Type="Int32" />
            </InsertParameters>
        </asp:SqlDataSource>
    </p>
</asp:Content>
